CC = g++
CFLAGS = -Wall -Wextra -O2 -g
LDFLAGS = -levent
TARGET = server
SRC = server.cpp

# 默认构建目标
all: $(TARGET)

$(TARGET): $(SRC)
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

# 清理编译产物
clean:
	rm -f $(TARGET) *.o

# 安装依赖（Ubuntu/Debian）
install-deps:
	sudo apt-get install -y libevent-dev g++ make
